package Vista;
import java.rmi.RemoteException;
import java.util.Iterator;
import java.util.List;

import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

import conexion.ProxyIR;

import VO.CondicionesPagoVO;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class AltaCliente extends javax.swing.JFrame {
	private JLabel jLabel1;
	private JLabel jLabel2;
	private JLabel jLabel3;
	private JLabel jLabel4;
	private JLabel jLabel5;
	private JButton jButtonAceptar;
	private JComboBox jCCondPago;
	private JCheckBox jCResposableIns;
	private JTextField jTTelefono;
	private JTextField jDireccion;
	private JTextField jTRazonSocial;
	private JTextField jTCUIT;
	private JLabel jLabel6;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				AltaCliente inst = new AltaCliente();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public AltaCliente() {
		super();
		initGUI();

	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			{
				jLabel1 = new JLabel();
				getContentPane().add(jLabel1);
				jLabel1.setText("CUIT");
				jLabel1.setBounds(12, 12, 126, 16);
			}
			{
				jLabel2 = new JLabel();
				getContentPane().add(jLabel2);
				jLabel2.setText("Razon Social");
				jLabel2.setBounds(12, 40, 126, 16);
			}
			{
				jLabel3 = new JLabel();
				getContentPane().add(jLabel3);
				jLabel3.setText("Direccion");
				jLabel3.setBounds(12, 68, 126, 16);
			}
			{
				jLabel4 = new JLabel();
				getContentPane().add(jLabel4);
				jLabel4.setText("Telefono");
				jLabel4.setBounds(12, 96, 126, 16);
			}
			{
				jLabel5 = new JLabel();
				getContentPane().add(jLabel5);
				jLabel5.setText("Resposable Inscripto");
				jLabel5.setBounds(12, 124, 126, 16);
			}
			{
				jLabel6 = new JLabel();
				getContentPane().add(jLabel6);
				jLabel6.setText("Condiciones de Pago");
				jLabel6.setBounds(12, 152, 126, 16);
			}
			{
				jTCUIT = new JTextField();
				getContentPane().add(jTCUIT);
				jTCUIT.setBounds(200, 9, 148, 23);
			}
			{
				jTRazonSocial = new JTextField();
				getContentPane().add(jTRazonSocial);
				jTRazonSocial.setBounds(200, 37, 148, 23);
			}
			{
				jDireccion = new JTextField();
				getContentPane().add(jDireccion);
				jDireccion.setBounds(200, 65, 148, 23);
			}
			{
				jTTelefono = new JTextField();
				getContentPane().add(jTTelefono);
				jTTelefono.setBounds(200, 93, 148, 23);
			}
			{
				jCResposableIns = new JCheckBox();
				getContentPane().add(jCResposableIns);
				jCResposableIns.setBounds(200, 122, 42, 17);
			}
			{
				jCCondPago = new JComboBox();
				getContentPane().add(jCCondPago);
				jCCondPago.setBounds(200, 149, 148, 23);
				
				List<CondicionesPagoVO> cond = ProxyIR.getInstance().getCondicionesPagoVO();
				Iterator<CondicionesPagoVO> it = cond.iterator();
				while(it.hasNext()){
					CondicionesPagoVO item = it.next();
					String id = item.getIdCondicion().toString();
					String fpago = item.getFormaDePago();
					jCCondPago.addItem(id + "." + fpago);					
				}

				
				
			}
			{
				jButtonAceptar = new JButton();
				getContentPane().add(jButtonAceptar);
				jButtonAceptar.setText("Aceptar");
				jButtonAceptar.setBounds(241, 216, 107, 23);
			}
			pack();
			this.setSize(405, 288);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
